/**
 * 共享单词本相关 API
 * @author 杨世峰
 */

import request from '@/utils/request'

export function getShareBooklets(params) {
    return request({
        method: 'get',
        url: '/booklets/sharedBooklets',
        params: params
    })
}

export function getShareBookletDetail(bookletId) {
    return request({
        method: 'get',
        url: '/booklets/sharedBooklets/' + bookletId
    })
}

export function hasShareBook(bookletId, data) {
    return request({
        method: 'put',
        url: '/booklets/sharedBooklets/'+ bookletId + '/collection',
        data: data
    })
}

export function shareBooklet(bookletId) {
    return request({
        method: 'put',
        url: '/booklets/sharedBooklets/' + bookletId,
    })
}

export function deleteShareBooklet(bookletId) {
    return request({
        method: 'delete',
        url: '/admin/sharedBooklets/' + bookletId
    })
}